package Service;

import Dao.UserDao;
import Entity.User;

public class UserService {
	public UserDao dao = null;
	
	public UserService(){dao = new UserDao();}
	
	public boolean UpdateUser(String uid, String newpwd){
		User user = dao.findByNumber(uid);
		user.setPassword(newpwd);
		return dao.updateUser(user);
	}
	public static void main(String args[]){
		UserDao ser=new UserDao();
		User e= ser.findByNumber("njust");
		e.setName("马天雄");
		ser.updateUser(e);
		System.out.println("id"+e.getNumber()+" name"+e.getName());
	}
}
